package com.xxwy.bean.register;

/**
 * .
 *
 * @author xxwy
 * @date 2021/10/11 0011
 */

import com.xxwy.bean.User;
import lombok.ToString;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@ToString
public class Config {

    @Autowired
    private AnnotationBeanDefinitionDemo annotationBeanDefinitionDemo;

    public Config() {
        System.out.println("Config类实例化");
    }

    @Bean(name = {"ni"})
      User user() {
        User user = new User("xxx", 4);
        System.out.println("@Bean方法调用。。ni实例化");
        return user;
    }
}